package person.wend.javalearnexample.util.concurrent.executor;

import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

public class ExecutorExample {
    public static void main(String[] args) {
        // 创建一个 Executor 实例，这里使用 Executors 工厂方法创建一个固定大小的线程池
        Executor executor = Executors.newFixedThreadPool(5);

        // 提交任务到 Executor
        executor.execute(new Runnable() {
            @Override
            public void run() {
                System.out.println("Task is being executed by: " + Thread.currentThread().getName());
            }
        });
    }
}
